<?xml version="1.0"?> 
<xsl:stylesheet	version="1.0" 
				xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
				xmlns:captor="captor.lib.xalan.extensions.CaptorExtension"
				extension-element-prefixes="captor">

	<xsl:output method="text"/>
	<xsl:template match="/">

	package fwslib;

	import java.util.Vector;
	import fws.FWS;


	/**
	 * @author Kicho
	 *
	 */
	public class DataBanker {

	    private static Vector v = new Vector();
	    
	    //-------------------------------------------------------------------------
	    
	    public static void init()  {
	        for ( int i = 0; i &lt; FWS.HistoryLenght; i++ )  {
	            v.addElement(new SensorReading(0, 1,0));
	        }
	    }

	    //-------------------------------------------------------------------------

	    public static synchronized void write(SensorReading r)  {
	        v.removeElementAt(0);
	        SensorReading sr = new SensorReading(r.getID(), r.res, r.value);
			<captor:extensionset crosscuttingdomain="Persistence">
			sr.save();
			</captor:extensionset>
	        v.addElement(sr);
	    }
	    
	    //-------------------------------------------------------------------------
	    
	    public static synchronized Vector read()  {
	        return (Vector) v.clone();
	    }
	    
	    //-------------------------------------------------------------------------
	}

	
	</xsl:template>

</xsl:stylesheet>